
<div class="am-u-sm-12 widget main-w" >
    <div class="am-u-sm-12">
        <form class="am-form-inline tpl-form-border-form" action="" method="get">
            <div class="am-u-sm-12">
                <div class="am-u-sm-2">
                    <div class="am-form-group am-u-sm-12 cl-p">
                    </div>
                </div>
                <div class="am-u-sm-2 cl-p">

                    <div class="am-form-group am-u-sm-12 cl-p">
                        <div class="am-u-sm-12 cl-p po_relative">
                        </div>
                    </div>
                </div>
                <div class="am-u-sm-2">
                    <div class="am-form-group am-u-sm-12 cl-p">
                    </div>
                </div>
                <div class="am-u-sm-6">
                </div>
            </div>
        </form>
    </div>
    <div class="am-u-sm-12" style="position: relative;height: 100%;page-break-before:auto;page-break-after: always;">
        <div id="map" data-map="1" style="width: 100%;min-height: 500px;margin-top:20px ;" ></div>
        <div class="toolshow" style="text-align: center;">
            <i class="am-icon-bars" style="line-height: 34px;"></i>
        </div>
        <div id="panel"></div>
        <div id="tip">
        </div>
        <div id="pickerBox" style="display: none;">
            <div id="poiInfo"></div>
        </div>
        <div class='button-group' style="background-color: #0d9bf2;color:#fff;display: none;">


        </div>





    </div>
</div>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.2&key={:config('base.mapkey')}&plugin=AMap.Driving,AMap.Scale,AMap.OverView,AMap.ToolBar,AMap.MouseTool,AMap.DistrictSearch,AMap.MarkerClusterer"></script>
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="{$static_dir}/assets/js/jquery.liMarquee.js"></script>
<script>
    //滚动信息

    $.ajax({
        type:"post",
        url:"{:url('adminapi/order/getExceptionOrder')}",
        success:function(res){
            ajaxalarm(1)
            console.log(res)
            if(res.code==1){
                var strbody="";
                var wid=0;
                for(var i=0 ;i<res.data.length;i++){
                    if(res.data[i].exception_type==1){
                        dispresult='司机出发地偏离,订单轨迹偏移'
                    }else if(res.data[i].exception_type==2){
                        dispresult=' 司机目的地偏离,订单轨迹偏移'
                    }else if(res.data[i].exception_type==4){
                        dispresult='订单超时,订单轨迹偏移'
                    }else if(res.data[i].exception_type==8){
//						dispresult='订单超里程'
                    }else if(res.data[i].exception_type==3){
                        dispresult='司机出发地偏离,司机目的地偏离,订单轨迹偏移'
                    }else if(res.data[i].exception_type==5){
                        dispresult='司机出发地偏离,订单超时,订单轨迹偏移'
                    }else if(res.data[i].exception_type==9){
                        dispresult='司机出发地偏离,订单轨迹偏移'
                    }else if(res.data[i].exception_type==6){
                        dispresult='司机目的地偏离,订单超时,订单轨迹偏移'
                    }else if(res.data[i].exception_type==10){
                        dispresult='司机目的地偏离,订单轨迹偏移'
                    }else if(res.data[i].exception_type==12){
                        dispresult='订单超时,订单轨迹偏移'
                    }else if(res.data[i].exception_type==7){
                        dispresult='司机出发地偏离,司机目的地偏离,订单超时'
                    }else if(res.data[i].exception_type==11){
                        dispresult='司机出发地偏离,司机目的地偏离,订单轨迹偏移'
                    }else if(res.data[i].exception_type==13){
                        dispresult='司机出发地偏离,订单超时,订单轨迹偏移'
                    }else if(res.data[i].exception_type==14){
                        dispresult='司机目的地偏离,订单超时,订单轨迹偏移'
                    }else if(res.data[i].exception_type==15){
                        dispresult='司机出发地偏离,司机目的地偏离,订单超时,订单轨迹偏移'
                    }else{
                        dispresult='订单轨迹偏移'
                    }
                    if(res.data[i].has_solve==1){}else{
                        strbody+=`<li style="float: left;padding-left:50px ;color:red">订单${res.data[i].order_no}(${dispresult})</li>`
                    }
                }
                console.log(res)
                $('.str3 ul').html(`${strbody}`)
                for(var j=0;j<$('.str3 ul li').length;j++){
                    var num=$('.str3 ul li').eq(j).width()-0
                    wid+=num
                }
                wid += $('.str3 ul li').length * 80;

                $('.str3 ul').css('width',wid)

            }

            $('.str3').on('click', function() {
                choosecar("{:url('alarm',['op'=>'search'])}", '异常');
            })
            alarint=setTimeout(function() {
                ajaxalarm(2)
            },10000)
        }

    });
    function ajaxalarm(type){
        var panduan=0;
        $.ajax({
            type:"post",
            url:"{:url('adminapi/order/getExceptionOrder')}",
            success:function(res){
                var alarmconut=0;

                for(var ii2=0 ;ii2<res.data.length;ii2++){
                    if(res.data[ii2].has_solve==9){
                        panduan=1
                    }
                }
                console.log(panduan)
                if(panduan==1){

                    var alarm_hint=layer.open({
                        type: 1,
                        title:false,
                        id: 'alarmprop',
                        offset: 'rb',
                        skin: 'layui-layer-rim', //加上边框
                        area: ['300px', '120px'],
                        shade: 0  ,//不显示遮罩//宽高
                        content: `<div class='am-u-sm-12' style="padding:20px">
						  				<div class='am-u-sm-12' style='text-align: center;'>有异常订单未处理</div>
						  				<div class='am-u-sm-12' style='text-align: center;'>
						  				<button class="am-btn am-btn-sm am-radius am-btn-primary alarm_dispose">处理</button>
						  				<button class="am-btn am-btn-sm am-radius am-btn-primary prop_close">取消</button>
						  				</div>
						  			</div>`,
                        success:function(){
                            $('.alarm_dispose').on('click',function(){

                                choosecar("{:url('alarm',['op'=>'search'])}", '异常');
                                layer.close(alarm_hint)

                            });
                            $('.prop_close').on('click',function(){
                                layer.close(alarm_hint)
                            })
                        }
                    });
                }else{

                }

                alarint=setTimeout(function() {
                    ajaxalarm(2)
                },10000)
            }
        })
    }
</script>
<!--<script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>-->
<!--<script src="{$static_dir}/assets/js/maporigin.js"></script>-->
<script src="{$static_dir}/assets/js/mapsearch.js"></script>
<script src="{$static_dir}/assets/js/maptool.js"></script>


